Otherwise the handler will be associated with the `globalThis`
object and never get disconnected automatically.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4382>
(cherry picked from commit
1579879c666448c090d2009c98cb3840c7811652)
if (HAVE_REQUIRE_SURROUNDING_TEXT)
this._context.connect('require-surrounding-text', this._onRequireSurroundingText.bind(this));
- Main.keyboard.connectObject('visibility-changed', () => this._updateCapabilities());
+ Main.keyboard.connectObject(
+ 'visibility-changed', () => this._updateCapabilities(),
+ this);
this._updateCapabilities();
}